﻿<phone:PhoneApplicationPage
    x:Class="GY.WP.PostMemo.Views.MemoDesktop"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:c4fControls="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"
    toolkit:TiltEffect.IsTiltEnabled="True"
    >

    <Grid x:Name="LayoutRoot" Background="Transparent">

        <StackPanel x:Name="TitlePanel" VerticalAlignment="Top" Margin="24,17,0,10">
            <TextBlock x:Name="ApplicationTitle" Text="{Binding Path=AppName, Source={StaticResource LocalizedStrings}}"/>
        </StackPanel>

        <Grid x:Name="ContentPanel" Margin="0,50,0,90">
            <ListBox x:Name="listBoxMemoList"
                     VerticalAlignment="Bottom"
                     ItemsSource="{Binding MemoList}"
                     >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <c4fControls:ChatBubble Margin="10,0,10,20"
                                                Name="chatBubbleDisplayMemo"
                                                Width="460"
                                                ChatBubbleDirection="LowerRight">
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu>
                                    <toolkit:MenuItem Name="menuItemCopy"
                                                      Header="{Binding Path=MenuItem_Copy, Source={StaticResource LocalizedStrings}}"
                                                      Tap="menuItemCopy_Tap"
                                                      CommandParameter="{Binding}"/>
                                    <toolkit:MenuItem Name="menuItemDelete"
                                                      Header="{Binding Path=MenuItem_Delete, Source={StaticResource LocalizedStrings}}"
                                                      Tap="menuItemDelete_Tap"
                                                      CommandParameter="{Binding}"/>
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                            <StackPanel>
                                <TextBlock Text="{Binding MemoContent}"
                                           Name="textBlockContent"
                                           Foreground="LightYellow"
                                           TextWrapping="Wrap"/>
                                <TextBlock Text="{Binding MemoDateTime, Converter={StaticResource DateTimeToStringConverter}}"
                                           FontSize="16"
                                           TextAlignment="Right"
                                           HorizontalAlignment="Right"
                                           Foreground="LightYellow"
                                           Width="460"/>
                            </StackPanel>
                        </c4fControls:ChatBubble>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>

        <StackPanel VerticalAlignment="Bottom">
            <c4fControls:ChatBubbleTextBox Name="chatBubbleTextBoxMemo"
                                           Opacity="0.9"
                                           FontSize="40"
                                           AcceptsReturn="True"
                                           TextWrapping="Wrap"
                                           ChatBubbleDirection="LowerRight"
                                           MaxLength="1000"
                                           Margin="10,0,10,0"
                                           />
        </StackPanel>
    </Grid>

    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.send.rest.png" x:Name="appBarPost" Text="Post" Click="appBarPost_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="appBarFullView" Text="Full View"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>
